package org.pidan.basic.designModel.factory.easyFactory;

import org.pidan.basic.designModel.factory.factoryMethod.Bmw;

/**
 * {@code @description}: 创建核心工厂类，由他决定具体调用哪产品；
 * {@code @author}: huangyuxin
 * {@code @date}: 2023-11-16
 */

public class CarFactory {

    public static JianDan createCar(String name) {

        if ("".equals(name)) {
            return null;
        }

        if (name.equals("玛莎拉蒂")) {
            return new Maserati();
        }

        if (name.equals("兰博基尼")) {
            return new Lamborghini();
        }
        return null;
    }
}
